﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace NewRen.Models.ViewModel
{
    public class vPwdEdit
    {
        [Required]
        public int ID { get; set; }
        /// <summary>
        /// 商家名称
        /// </summary>
        public string BusinessName { get; set; }

        /// <summary>
        /// 牛棚名称
        /// </summary>
        public string GroupName { get; set; }
        
        public string UserName { get; set; }

        [Display(Name = "原始密码")]
        public string Password { get; set; }

        [Display(Name = "新密码")]
        public string PasswordNew { set; get; }
        public byte[] Picture { get; set; }

        public vPwdEdit() { }
        public vPwdEdit(User user)
        {
            this.ID = user.ID;
            this.UserName = user.UserName;
            this.Picture = user.Picture;
            this.Password = user.Password;
        }
        public vPwdEdit(Business business)
        {
            this.ID = business.ID;
            this.BusinessName = business.BusinessName;
            this.Picture = business.Picture;
            this.Password = business.LoginPassword;
        }
        public vPwdEdit(UserGroup group)
        {
            this.ID = group.ID;
            this.GroupName = group.GroupName;
            this.Picture = group.Picture;
            this.Password = group.LoginPassword;
        }
    }
}